home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
demos
/
interact
/
zplot3.tru
< prev
Wrap
Text File
|
1994-08-02
|
1KB
|
56 lines
!
! ZPLOT3 version 2.0
!
! Show the 3-dimensional plot of a rather peculiar
! function F(x,y). Choose a nice camera position at
! the start, then loop letting the user pick a new
! camera position.
!
! This is a perspective view. Change "PersWindow" to
! "ParaWindow" to get a parallel view.
!
LIBRARY "../3d/3dcont.trc","../3d/3dlib.trc"
randomize
call tw_wset_title(0,"zplot3")
CALL PersWindow(-pi,pi,-pi,pi,-1.5,1.2)
LET x = -3
LET y = -5
LET z = 4
DO
set color "white"
PRINT "Eye <ctrl-C to exit>: ";x;y;z
set color rnd*(16)+1
call draw_image
do while not key input
if refresh(0)=1 then
clear
call draw_image
end if
get mouse xtmp,ytmp,state
if state<>0 then stop
loop
GET KEY xxx
CLEAR
set color "white"
print "eye: ";
do while not key input
if refresh(0)=1 then
clear
print "eye: ";
end if
loop
input x,y,z
CLEAR
LOOP
sub draw_image
CALL SetCamera3(x,y,z)
CALL Zplot
end sub
END
DEF F(x,y)
LET a = x*x + y*y
LET F = 3.5*cos(1.75*a)*exp(-.8*a)
END DEF